<?php
abstract class AbsSessionHandle {
	protected $lifetime;
	protected $cfg;
	
	protected function __construct($cfg) {
		$this->cfg = $cfg;
		if($this->cfg['lifetime'] != 0) {
			$this->lifetime = $this->cfg['lifetime'];
		} elseif (((int)ini_get('session.gc_maxlifetime')) != 0) {
			$this->lifetime = (int)ini_get('session.gc_maxlifetime');
		} else {
			//这是php默认配置
			$this->lifetime = 1440;
		}
	}
	
	abstract public function open($savepath, $name);
	
	abstract public function close();
	
	abstract public function read($id);
	
	abstract public function write($id, $sess_data);
	
	abstract public function destroy($id);
	
	abstract public function gc($maxlifetime);
}
?>